package org.moonshot.chatty.lex;

public enum LexemeType
{
    PERIOD("period (.)"),
    BAR("bar (|)"),
    ASSIGN("assignment (:=)"),
    RETURN("return (^)"),
    COMMA("comma (,)"),
    
    OPAREN("'(' parenthese"), CPAREN("')' parenthese"),
    OBRACK("'[' bracket"), CBRACK("']' bracket"),
    
    BINOP("binary operator"),
    FRAGMENT("keyword"),
    IDENT("identifier"),
    STRING("string literal"),
    NUMBER("numeric literal"),
    
    EOF("end of document"), LITARR("literal array start");
    
    public final String readable;
    
    private LexemeType(String aReadable)
    {
        readable = aReadable;
    }
    
    public boolean matchAny (LexemeType[] aExpected)
    {
        for( LexemeType theType : aExpected )
            if( this.equals(theType) )
                return true;
        return false;
    }
}
